<?php
define('APPLICATION_PATH', 'E:\webapp\jsc\trunk\application');
require_once 'simpletest/unit_tester.php';
require_once 'simpletest/reporter.php';
require_once dirname(__FILE__) . '/../Calendar/Line.php';

class CalendarlineTest extends UnitTestCase
{
	protected $_objCompo;
	public function setUp()
	{
		parent::setUp();
		$this->_objCompo
		= new Components_Calendar_Line(
			'testLine',
			Components_Calendar_Line::JUNIOR_SCHOOL);

	}
	/**
	 * 4学年分のチェックボックスを生成する
	 */
	public function Test1100()
	{
		$this->_objCompo->addSchedule('1年生', '12月24日（土）', '13:00', '富士見');
		$this->_objCompo->addSchedule('3年生', '12月24日（土）', '13:00', '富士見');
		$sHtml = $this->_objCompo->fetch();
		echo $sHtml;
		$this->mkHtml($sHtml, 'Test1100');
	}

	protected function mkHtml($sHtml, $sPref)
	{
		$sCompileDir = $this->_objCompo->getCompileDir();
		$sInput = file_get_contents(dirname(__FILE__).'/NewFile.html');
		$sOutput = str_replace('#contents', $sHtml, $sInput);
		file_put_contents($sCompileDir.'/testLine_'.$sPref.'.html', $sOutput);
	}
}